﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SamNeirinck.ExtensionMethods
{
    public static class DoubleExtensions
    {

        public static double Clamp(this double d, double min, double max)
        {
            if (d < min)
                d = min;

            else if (d > max)
                d = max;

            return d;
        }
    }
}
